hey i need help with this
this error keeps popping up on line 20 invalid operands of types `int' and `int ()(int)' to binary `operator-'
is there any help i can get please help me!!!
thank you so much.
im sorry if i broke any rules but im getting desperate right now. i searched every where but i cant find the answer for it so please help me.
this error keeps popping up on line 20 invalid operands of types `int' and `int ()(int)' to binary `operator-'
is there any help i can get please help me!!!
thank you so much.
im sorry if i broke any rules but im getting desperate right now. i searched every where but i cant find the answer for it so please help me.
Code:
#include <cstdlib> #include <iostream> using namespace std; int h(int h=100); int l(int l = 10); int d(int d = 0); int subtraction (int h, int l); int subtraction (int h, int d) { if (h) { return h - l; } else { if (d) { return h - d; } } } int main(int arg, char *argv[]) { int d; int l; int h; //damage if ( 1 == 1) { cout << subtraction (h, l) << endl; } else { if ( 1 == 2) { cout << subtraction(h, l) << endl; } else { if ( 1 == 3) { cout << subtraction(h, l) << endl; } else { if ( 1 == 4) { cout << subtraction(h, l) << endl; } else { if ( 1 == 5) { cout << subtraction(h, d) << endl; } } } } } if ( 2 == 1) { cout << subtraction(h, l) << endl; } else { if ( 2 == 2) { cout << subtraction(h, l) << endl; } else { if ( 2 == 3) { cout << subtraction(h, l) << endl; } else { if ( 2 == 4) { cout << subtraction(h, l) << endl; } else { if ( 2 == 5) { cout << subtraction(h, d) << endl; } } } } } if ( 3 == 1) { cout << subtraction(h, l) << endl; } else { if ( 3 == 2) { cout << subtraction(h, l) << endl; } else { if ( 3 == 3) { cout << subtraction(h, d) << endl; } else { if ( 3 == 4) { cout << subtraction(h, d) << endl; } else { if ( 3 == 5) { cout << subtraction(h, l) << endl; } } } } } if ( 4 == 1) { cout << subtraction(h, l) << endl; } else { if ( 4 == 2) { cout << subtraction(h, l) << endl; } else { if ( 4 == 3) { cout << subtraction(h, d) << endl; } else { if ( 4 == 4) { cout << subtraction(h, d) << endl; } else { if ( 4 == 5) { cout << subtraction(h, l) << endl; } } } } } if ( 5 == 1) { cout << subtraction(h, d) << endl; } else { if ( 5 == 2) { cout << subtraction(h, d) << endl; } else { if ( 5 == 3) { cout << subtraction(h, l) << endl; } else { if ( 5 == 4) { cout << subtraction(h, l) << endl; } else { if ( 5 == 5) { cout << subtraction(h, d) << endl; } } } } } system("PAUSE"); return 0; }
Comment